home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-serious-
/
misc
/
catmanged
/
scripts
/
copyorig.ged
< prev
next >
Wrap
Text File
|
1999-09-06
|
3KB
|
101 lines
/*
** $VER: CopyOrig 1.0 (30.08.99)
**
** Script author: Damir Arh
**
** (C)1999 Digital Amiga Dream
**
**
** FUNCTION:
** ARexx-script for GoldEd.
** Copies original strings from CD to CT
**
** USAGE:
** CopyOrig
**
** $HISTORY:
**
** 07.04.99 : 1.0 : First release
*/
OPTIONS RESULTS /* enable return codes */
if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */
if (RC ~= 0) then
exit
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
/* ------------------------ INSERT YOUR CODE HERE: ------------------- */
'WINDOW NEXT'
'FIRST'
'WINDOW PREV'
'FIRST' /* find first string name - skip headers and comments) */
do until ((CurrChar~=c2d('#')) & (CurrChar~=c2d(';')))
'FIND STRING="(" NEXT QUIET' /* find next string name */
'FIRST'
'QUERY CODE VAR=CurrChar'
end
'QUERY LINES VAR=NumLines'
do until (NumLines < CurrLine+2)
'QUERY WORD VAR=CurrStringName' /* get string name */
'DOWN'
'MARK SET BEGIN' /* block beginning */
do until (CurrChar = c2d(';')) /* find block end */
'DOWN'
'LEFT'
'FIND STRING=";" NEXT QUIET'
'FIRST'
'QUERY CODE VAR=CurrChar'
end
'MARK SET END'
'CLIP COPY' /* copy block to clipboard */
'WINDOW NEXT QUIET' /* toggle window */
'FIND STRING="' || CurrStringName || '" NEXT QUIET'
do until (CurrChar = c2d(';')) /* find end of the matching string */
'DOWN'
'LEFT'
'FIND STRING=";" NEXT QUIET'
'FIRST'
'QUERY CODE VAR=CurrChar'
end
'CLIP PASTE' /* paste original string */
do until (CurrChar = c2d(';')) /* comment the original string */
'TEXT T=";"'
'DOWN'
'FIRST'
'QUERY CODE VAR=CurrChar'
end
'DELETE LINE'
'WINDOW PREV QUIET' /* switch window back */
do until ((CurrChar~=c2d('#')) & (CurrChar~=c2d(';')))
'FIND STRING="(" NEXT QUIET' /* find next string name */
'FIRST'
'QUERY CODE VAR=CurrChar'
end
'QUERY LINE VAR=CurrLine'
end
/* ---------------------------- END OF YOUR CODE --------------------- */
'UNLOCK' /* VERY important: unlock GUI */
exit
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
'UNLOCK'
exit